<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/
/* 前台路由指向 */
/* pc版 */
Route::group(
    ['namespace' => 'Main'],
    function () {
        Route::get('/', 'IndexController@index');
        Route::get('about', 'AboutController@about');
        Route::get('case', 'CaseController@index');
        Route::get('case/category/{id}', 'CaseController@category');
        # 案例瀑布流
        Route::get('case/list/{category}/{page}', 'CaseController@caseList');
        # 案例详情页（临时 新窗口）
        Route::get('case/detail/{id}', 'CaseController@detail');
        # 案例详情接口
        Route::get('case/show/{id}', 'CaseController@show');
        Route::get('client', 'ClientController@client');
        Route::get('contact', 'ContactController@contact');
        Route::get('article', 'NewsController@index');
        Route::get('article/page/{page}', 'NewsController@index');
        Route::get('article/{id}', 'NewsController@detail');
        Route::get('service', 'ServiceController@service');
        Route::get('recruit', 'RecruitController@index');
        Route::get('case/like/{id}', 'CaseController@like');
        Route::get('message','ContactController@message');
        Route::post('submit','ContactController@save');
    }
);
/* 移动版 */
Route::group(
    ['prefix' => 'mobile','namespace' => 'Mobile'],
    function () {
        Route::get('/', 'IndexController@index');
        Route::get('about', 'AboutController@index');
        Route::get('case', 'CaseController@index');
        Route::get('case/getInfo', 'CaseController@getInfo');
        Route::get('case/detail/{id}', 'CaseController@detail');
        Route::get('case/jump/{id}', 'CaseController@jump');
    }
);
/* 后台路由指向 */

Route::group(
    ['prefix' => 'manage', 'namespace' => 'Manage'],
    function () {

        Route::get('login', 'ManageController@login');
        Route::get('captcha', 'ManageController@captcha');
        Route::post('login', 'ManageController@verify');
        Route::get('logout', 'ManageController@logout');
        Route::get('login1', 'ManageController@login1'); // 测试验证短信登录
        Route::post('phone', 'ManageController@verifyPhone'); // 发送短信验证码
        Route::post('lphone', 'ManageController@verifyLogin'); // 短信验证码登录
    }
);

Route::group(
    ['prefix' => 'manage', 'as' => 'manage.', 'namespace' => 'Manage', 'middleware' => 'manage'],
    function() {
        Route::get('/', 'IndexController@index');
        Route::get('index', 'IndexController@index');
        Route::get('manage', 'IndexController@manage');
    }
);

# REST ful
Route::group(
    ['prefix' => 'manage', 'middleware' => 'manage', 'namespace' => 'Manage'],
    function() {
        Route::get('user/setStatus', 'UserController@setStatus');#设置管理员状态
        Route::get('role/setStatus', 'RoleController@setStatus');#设置角色状态
        Route::get('position/setStatus', 'PositionController@setStatus');#设置招聘职位状态
        Route::post('casebatcdel', 'CaseController@casedel');#批量删除案例
        Route::any('casebatcserc', 'CaseController@casesearch');#搜索案例
        Route::get('casebatcstatus/{id}', 'CaseController@casestatus');#批量修改案例状态
        Route::get('config/slide', 'ConfigController@slide');#轮播图
        Route::post('config/setSlide', 'ConfigController@setSlide');#设置轮播图
        Route::get('config/getSlide', 'ConfigController@getSlide');#设置轮播图

//        Route::get('article/seo', 'ArticleController@seo');#新闻seo页
//        Route::get('article/setSeo', 'ArticleController@setSeo');#修改新闻seo
        # 通用数据管理
        Route::resource('resource', 'ResourceController');

        Route::resource('user', 'UserController'); # 用户管理
        Route::resource('casecate', 'CasecateController'); # 案例分类
        Route::resource('case', 'CaseController'); # 案例管理
        Route::resource('category', 'CategoryController'); # 文章分类
        Route::resource('article','ArticleController'); # 文章管理
        Route::resource('member', 'MemberController'); # 会员管理
        Route::resource('message','MessageController');//留言管理
        Route::resource('role','RoleController');# 角色管理
        Route::resource('position','PositionController');# 招聘管理
    }
);
Route::group(
    ['prefix' => 'manage', 'middleware' => 'manage', 'namespace' => 'Manage'],
    function() {
        #客户管理
        Route::any('client', 'ClientController@index');
        Route::get('client/add', 'ClientController@add');
        Route::post('client/addClient', 'ClientController@addClient');
        Route::get('client/edit/{id}', 'ClientController@edit');
        Route::post('client/save', 'ClientController@save');
        Route::get('client/setStatus', 'ClientController@setStatus');
        #授权管理
        Route::any('rule', 'RuleController@index');
        Route::get('rule/create', 'RuleController@create');#添加权限
        Route::post('rule/store', 'RuleController@store');#添加权限
        Route::get('rule/setRule', 'RuleController@setRule');#修改权限
        Route::get('rule/destroy', 'RuleController@destroy');#删除权限
    }
);
Route::group(
    ['prefix' => 'manage', 'as' => 'manage.', 'namespace' => 'Manage', 'middleware' => 'manage'],
    function() {
        Route::post('artibatcdel', 'BatchController@articledel');
        Route::any('artibatcserc', 'BatchController@articlesearch');
        Route::get('artibatcstatus/{id}', 'BatchController@artitatus');
        Route::post('aritbatcexport', 'BatchController@articleexport');
        Route::get('messbatcdel','BatchController@messagedel');
    }
);


